{--


Q-Bot 0.0.1 alpha

This module implements all important rules of lambda the gathering

@Version 0.0.1
@Author Benjamin Schubert

--}

import Representation as R

{--
Updates the game environment after a turne is played

--}
updateGame::Bool->Action->Action->Game->Game
updateGame isPlayer2 opA propA game 
                                    | isPlayer2 = applyAction propA $ applyAction opA game
                                    | otherwise = applyAction opA $ applyAction propA game   

--Applies an action 
applyAction::Action->Game->Game
applyAction a game 
                  | R.app a == 2 = applySlot2Card (R.field a) (R.card a) game
                  | otherwise = applyCard2Slot (R.field a) (R.card a) game
                  
{--
Applies a Card to a slot also called left application
--}